﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing.Drawing2D;

namespace CustomController
{
    public partial class CustomButton: Button
    {
        public CustomButton()
        {
            InitializeComponent();
            DoubleBuffered = true;
        }

        protected override void OnPaintBackground(PaintEventArgs pevent)
        {
            this.BackColor = Color.Transparent;
            Rectangle rc = new Rectangle(0, 0, this.Width, this.Height);
            using (LinearGradientBrush brush = new LinearGradientBrush(rc, Color.Red, Color.Blue, 45f))
            {
                pevent.Graphics.FillRectangle(brush, rc);
            } 

        }

     
    }
}
